﻿using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{
    public partial class MAS_EduMajors : System.Web.UI.Page
    {
        IMasEducationMajorBLL majorBLL = new MasEducationMajorBLL();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                LoadDataGrid();
            }

        }
        public void LoadDataGrid()
        {
            IList<MasEducationMajorInfo> Info = majorBLL.ListEducationMajors();
            RadGrid1.DataSource = Info;
            RadGrid1.DataBind();
        }

        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                int seq = Convert.ToInt32((e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Sequence"]);

                majorBLL.Delete(seq, 1);
            }
            LoadDataGrid();
        }
    }
}
